/* #root {
  width: 100%;
  height: 100%;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
} */

/* Joystick styles */
.joystick-container {
  position: absolute;
  bottom: 50px;
  left: 50px;
  z-index: 1000;
  opacity: 0.7;
}

/* Prevent pointer lock for UI elements */
.no-pointer-lock {
  pointer-events: auto !important;
}

/* Make sure the canvas is on top */
canvas {
  display: block;
  z-index: 0;
}

/* Instructions overlay */
.instructions {
  position: absolute;
  top: 10px;
  left: 10px;
  color: white;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 10px;
  border-radius: 5px;
  font-family: sans-serif;
  font-size: 14px;
  pointer-events: none;
  z-index: 1000;
}

/* Mesh Creator Button */
.mesh-creator-button {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background-color: #2a2a2a;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 1000;
  font-family: sans-serif;
  font-size: 14px;
  user-select: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s ease;
}

.mesh-creator-button:hover {
  background-color: #3a3a3a;
}

/* Code Editor */
.code-editor {
  position: absolute;
  bottom: 80px;
  left: 20px;
  width: 500px;
  height: 400px;
  background-color: #1e1e1e;
  color: white;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  z-index: 1001;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  font-family: monospace;
}

.code-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  border-bottom: 1px solid #333;
}

.code-editor-header h3 {
  margin: 0;
  font-size: 16px;
}

.close-button {
  background: none;
  border: none;
  color: #aaa;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.close-button:hover {
  color: white;
}

.code-textarea {
  flex: 1;
  background-color: #252525;
  color: #e6e6e6;
  border: none;
  padding: 10px;
  font-size: 14px;
  font-family: "Consolas", "Monaco", monospace;
  resize: none;
  outline: none;
}

.error-message {
  padding: 10px;
  background-color: #ff4444;
  color: white;
  font-size: 14px;
}

.code-editor-footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px;
  border-top: 1px solid #333;
}

.add-mesh-button {
  background-color: #4caf50;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.add-mesh-button:hover {
  background-color: #45a049;
}

/* Success Message */
.mesh-success-message {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #4caf50;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  font-family: sans-serif;
  font-size: 14px;
  z-index: 2000;
  animation: fade-in-out 3s forwards;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@keyframes fade-in-out {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  10% {
    opacity: 1;
    transform: translateY(0);
  }
  90% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Make sure these styles are mobile-friendly */
@media (max-width: 768px) {
  .code-editor {
    width: 90%;
    left: 5%;
    right: 5%;
    height: 60vh;
  }
}

/* Template Selector */
.template-selector {
  display: flex;
  padding: 5px 10px;
  background-color: #333;
  border-bottom: 1px solid #444;
}

.template-selector button {
  background-color: #444;
  color: white;
  border: none;
  padding: 5px 10px;
  margin-right: 5px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.2s ease;
}

.template-selector button:hover {
  background-color: #555;
}

.template-selector button:last-child {
  margin-right: 0;
}

/* Keyboard State Indicator */
.keyboard-state {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 1500;
  pointer-events: none;
}

.state-indicator {
  padding: 8px 12px;
  border-radius: 4px;
  color: white;
  font-family: sans-serif;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s ease;
}

.state-indicator.active {
  background-color: #4caf50;
}

.state-indicator.inactive {
  background-color: #f44336;
}

.state-note {
  padding: 5px 8px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 4px;
  font-family: sans-serif;
  font-size: 12px;
  text-align: center;
}

/* Highlight effect */
.highlighted-object {
  outline: 2px solid yellow;
  transition: outline-color 0.3s ease;
}

/* Transform controls info */
.transform-info {
  position: fixed;
  bottom: 60px;
  right: 10px;
  padding: 8px 12px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 4px;
  font-family: sans-serif;
  font-size: 12px;
  z-index: 1500;
  pointer-events: none;
}

.transform-info .mode {
  font-weight: bold;
  color: #4caf50;
}

/* Help tooltip */
.help-tooltip {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 15px;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 6px;
  font-family: sans-serif;
  font-size: 13px;
  z-index: 1500;
  pointer-events: none;
  max-width: 300px;
  border-left: 3px solid #4caf50;
}

.help-tooltip .help-header {
  font-size: 14px;
  margin-bottom: 8px;
  color: #4caf50;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 5px;
}

.help-tooltip div {
  margin-bottom: 5px;
}

.help-tooltip .help-note {
  margin-top: 8px;
  font-style: italic;
  color: #ffff00;
  font-size: 11px;
}

.help-tooltip strong {
  color: #4caf50;
}
